package com.kingmed.kmss.framework.feign.client.bpmn;

import java.util.List;

import com.kingmed.kmss.common.qc.bpmn.MyTaskQC;
import com.kingmed.kmss.common.vo.CommonPage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.kingmed.kmss.common.bo.bpmn.BpmnBO;
import com.kingmed.kmss.common.bo.bpmn.ProcessStarterBO;
import com.kingmed.kmss.common.bo.bpmn.TaskBO;
import com.kingmed.kmss.common.bo.bpmn.TaskExBO;
import com.kingmed.kmss.common.dto.bpmn.BizApprovalTrailDTO;
import com.kingmed.kmss.common.qc.bpmn.ApprovalTrailQC;
import com.kingmed.kmss.common.vo.CommonResponse;

@FeignClient(value = "kmss-bpmn", url = "${internalService.bpmnService.url}", contextId = "common-cust-bpmn-interface", fallbackFactory = CommonBpmnFallbackService.class)
public interface CommonBpmnFeignService {

	// "审批跟踪"
	@PostMapping(value = "/bpmn/ext/process/trail")
	CommonResponse<List<BizApprovalTrailDTO>> approvalTrail(@RequestBody ApprovalTrailQC qc);

	// 根据ProcessDefinitionKey开启一个流程实例
	@PostMapping(value = "/bpmn/ext/process/start")
	CommonResponse<BpmnBO> startProcessInstance(@RequestBody ProcessStarterBO procStarter);

	// 完成任务
	@PostMapping(value = "/bpmn/ext/task/complete")
	CommonResponse<List<TaskBO>> complete(@RequestBody TaskExBO taskExBO);

	@PostMapping(value = "/bpmn/ext/task/{taskId}")
	CommonResponse<TaskBO> findTask(@PathVariable String taskId);

	// 查询用户待办
	@PostMapping(value = "/bpmn/ext/task/todo")
	CommonResponse<CommonPage<TaskBO>> findTodoTask(@RequestBody MyTaskQC param);

}
